﻿Public Class Apropos
    Private Const BALL_WID As Integer = 56
    Private Const BALL_HGT As Integer = 70
    Private m_Dx As Integer
    Private m_Dy As Integer
    Private m_X As Integer
    Private m_Y As Integer
    Dim imagezg As Image = My.Resources.orange_tv_ericdesign13

    Private Sub btFermermer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btFermermer.Click
        Me.Close()
    End Sub

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked,
        LinkLabel2.LinkClicked, LinkLabel3.LinkClicked, LinkLabel4.LinkClicked, LinkLabel5.LinkClicked, LinkLabel6.LinkClicked,
        LinkLabel7.LinkClicked, LinkLabel8.LinkClicked, LinkLabel9.LinkClicked, LinkLabel10.LinkClicked, LinkLabel11.LinkClicked,
        LinkLabel12.LinkClicked, LinkLabel14.LinkClicked

        Dim linkprocess As New Process
        Process.Start(CType(sender, LinkLabel).Text)
    End Sub

    Private Sub Apropos_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim rnd As New Random
        m_Dx = rnd.Next(1, 4)
        m_Dy = rnd.Next(1, 4)
        m_X = rnd.Next(0, Me.ClientSize.Width - BALL_WID)
        m_Y = rnd.Next(0, Me.ClientSize.Height - BALL_HGT)

        Me.SetStyle( _
            ControlStyles.AllPaintingInWmPaint Or _
            ControlStyles.UserPaint Or _
            ControlStyles.DoubleBuffer, _
            True)
        Me.UpdateStyles()

    End Sub

    Private Sub tmrMoveBall_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrMoveBall.Tick
        m_X += m_Dx
        If m_X < 0 Then
            m_Dx = -m_Dx
        ElseIf m_X + BALL_WID > Me.ClientSize.Width Then
            m_Dx = -m_Dx
        End If

        m_Y += m_Dy
        If m_Y < 0 Then
            m_Dy = -m_Dy
        ElseIf m_Y + BALL_HGT > Me.ClientSize.Height Then
            m_Dy = -m_Dy
        End If

        Me.Invalidate()
    End Sub

    Private Sub Apropos_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
        '
        'e.Graphics.Clear(Me.BackColor)
        'e.Graphics.DrawImage(Image.FromHbitmap(My.Resources.orange_tv_ericdesign12.GetHbitmap), New Point(m_X, m_Y))
        e.Graphics.DrawImage(imagezg, New Point(m_X, m_Y))
    End Sub

End Class